package com.xingongchang.baolebei.activity;

import com.xingongchang.baolebei.R;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

public class OneActivity extends Activity{
	SharedPreferences preferences = null;
	boolean bool;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		preferences = getSharedPreferences("kk", MODE_PRIVATE);
		bool = preferences.getBoolean("false", true);
		new Thread(new Runnable() {
			// 1500毫秒自定跳转页面
			@Override
			public void run() {
				try {
					Thread.sleep(1500);
					if (bool == true) {
						Intent intent = new Intent(OneActivity.this,
								YingDao.class);
						startActivity(intent);
						OneActivity.this.finish();
						preferences.edit().putBoolean("false", false).commit();
					} else {
						Intent intent = new Intent(OneActivity.this,
								BaolebeiActivity.class);
						startActivity(intent);
						OneActivity.this.finish();
					}
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}).start();
	}
}
